package davidtps.godutch.adapter;

import java.util.List;

import davidtps.godutch.activity.R;
import davidtps.godutch.adapter.base.AdapterBase;
import davidtps.godutch.controls.SlideMenuViewItem;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class AdapterSlideMenuListView extends AdapterBase {

	private class Holder{
		TextView tvSlideMenuItem;
	}
	

	public AdapterSlideMenuListView(Context pContext, List pList) {
		super(pContext, pList);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		Holder _Holder;
		if(convertView==null){
			convertView = getLayoutInflater().inflate(R.layout.layout_slidemenu_item, null, true);
			
			_Holder = new Holder();
			_Holder.tvSlideMenuItem = (TextView)convertView.findViewById(R.id.tvSlideMenuItem);
			convertView.setTag(_Holder);
		}else{
			_Holder = (Holder)convertView.getTag();
		}
		
		SlideMenuViewItem mSlideMenuViewItem =  (SlideMenuViewItem) getList().get(position);
		_Holder.tvSlideMenuItem.setText(mSlideMenuViewItem.getMenuItemTitle());
		
		return convertView;
	}

}
